package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.PaymentOrdersMapper;
import com.hello.system.domain.PaymentOrders;
import com.hello.system.service.IPaymentOrdersService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 支付订单记录Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class PaymentOrdersServiceImpl extends ServiceImpl<PaymentOrdersMapper, PaymentOrders> implements IPaymentOrdersService 
{
    private final PaymentOrdersMapper paymentOrdersMapper;

    /**
     * 查询支付订单记录
     * 
     * @param orderId 支付订单记录主键
     * @return 支付订单记录
     */
    @Override
    public PaymentOrders selectPaymentOrdersByOrderId(String orderId)
    {
        return paymentOrdersMapper.selectPaymentOrdersByOrderId(orderId);
    }

    /**
     * 查询支付订单记录列表
     * 
     * @param paymentOrders 支付订单记录
     * @return 支付订单记录
     */
    @Override
    public List<PaymentOrders> selectPaymentOrdersList(PaymentOrders paymentOrders)
    {
        return paymentOrdersMapper.selectPaymentOrdersList(paymentOrders);
    }

    /**
     * 新增支付订单记录
     * 
     * @param paymentOrders 支付订单记录
     * @return 结果
     */
    @Override
    public int insertPaymentOrders(PaymentOrders paymentOrders)
    {
        paymentOrders.setCreateTime(DateUtils.getNowDate());
        return paymentOrdersMapper.insertPaymentOrders(paymentOrders);
    }

    /**
     * 修改支付订单记录
     * 
     * @param paymentOrders 支付订单记录
     * @return 结果
     */
    @Override
    public int updatePaymentOrders(PaymentOrders paymentOrders)
    {
        paymentOrders.setUpdateTime(DateUtils.getNowDate());
        return paymentOrdersMapper.updatePaymentOrders(paymentOrders);
    }


    /**
     * 批量删除支付订单记录
     * 
     * @param orderIds 需要删除的支付订单记录主键
     * @return 结果
     */
    @Override
    public int deletePaymentOrdersByOrderIds(String[] orderIds)
    {
        return paymentOrdersMapper.deletePaymentOrdersByOrderIds(orderIds);
    }

    /**
     * 删除支付订单记录信息
     * 
     * @param orderId 支付订单记录主键
     * @return 结果
     */
    @Override
    public int deletePaymentOrdersByOrderId(String orderId)
    {
        return paymentOrdersMapper.deletePaymentOrdersByOrderId(orderId);
    }
}
